package com.atguigu.lease.common.login;

/**
 * @author Admin
 * @title: LoginUserHolder
 * @projectName lease
 * @description: LoginUserHolder
 * @date 2025/2/17 21:41
 */
public class LoginUserHolder {
    public static ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        threadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}
